﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ClassAndObjectExamples
{
    public partial class Student : System.Web.UI.Page
        //one of the important five or six classes is page
        //create an object of the class student, populate it, and display it.
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
            // StudentLib.Student s = new StudentLib.Student(true); //make an object 
            // StudentLib.TransferStudent s = new StudentLib.TransferStudent(true); 
            StudentLib.Student s = new StudentLib.TransferStudent("University of Bridgeport", true);
            s.FirstName = txtFirstName.Text;
            s.LastName = txtLastName.Text;
            s.StreetAddress = txtStreetAddress.Text;
            s.City = txtCity.Text;
            s.State = txtState.Text;
            s.Zip = txtZip.Text;

            lblMailingLabel.Text = s.MailingLabel();
        }

        protected void btnClear_Click(object sender, EventArgs e)
        {
            txtFirstName.Text = "";
            txtLastName.Text = "";
            txtStreetAddress.Text = "";
            txtCity.Text = "";
            txtState.Text = "";
            txtZip.Text = "";

            lblMailingLabel.Text = "";
        }
    }
}